package org.ytor.core.sysapi.user.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ytor.common.util.bean.Beans;
import org.ytor.core.sqlflow.PersistenceModel;
import org.ytor.core.sqlflow.anno.Table;
import org.ytor.core.sysapi.user.resp.SysUserRoleResp;

/**
 * created by yangtong on 2025/4/8 14:09:51
 * <br/>
 * 用户-角色关系
 */
@Data
@Table("sys_user_role")
@EqualsAndHashCode(callSuper = true)
public class SysUserRole extends PersistenceModel<SysUserRole, String> {
    /**
     * 用户id
     */
    private String userId;

    /**
     * 角色id
     */
    private String roleId;

    @Override
    public SysUserRoleResp toResp() {
        return Beans.copyProperties(this, SysUserRoleResp.class);
    }
}
